<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!-- Title -->
  <xs:complexType name="T_title">
    <!-- Value-->
	  <xs:simpleContent>
		  <xs:extension base="xs:string">
        <!-- Language -->
			  <xs:attribute name="lang" type="xs:string"/>
		  </xs:extension>
	  </xs:simpleContent>
	</xs:complexType>
	<!-- Library -->
	<xs:element name="library">
		<xs:complexType>
			<xs:sequence>
        <!-- List of all Books -->
        <xs:element name="book" type="T_book" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
  <!-- Author -->
  <xs:complexType name="T_author">
    <xs:sequence>
      <!-- Name of the Author -->
      <xs:element name="name" type="xs:string"/>
      <!-- Date-->
			<xs:element name="born" type="xs:string"/>
      <!-- Date-->
			<xs:element name="dead" type="xs:string" minOccurs="0"/>
		</xs:sequence>
    <!-- ID -->
		<xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <!-- Book -->
  <xs:complexType name="T_book">
	  <xs:sequence>
      <!-- ISBN-->
				<xs:element name="isbn" type="xs:integer"/>
        <!-- Title -->
				<xs:element name="title" type="T_title"/>
        <!-- List of all Authors -->
				<xs:element name="author" type="T_author" minOccurs="0" maxOccurs="unbounded"/>
        <!-- List of all Characters -->
				<xs:element name="character" type="T_character" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
    <!-- ID -->
    <xs:attribute name="id" type="xs:string" use="required"/>
    <!-- Is available-->
	  <xs:attribute name="available" type="xs:boolean"/>
	</xs:complexType>

  <!-- Character -->
  <xs:complexType name="T_character">
		<xs:sequence>
      <!-- Name -->
			<xs:element name="name" type="xs:string"/>
      <!-- Date -->
			<xs:element name="born" type="xs:string"/>
      <!-- Qualification-->
			<xs:element name="qualification" type="xs:string"/>
		</xs:sequence>
    <!-- ID -->
		<xs:attribute name="id" type="xs:string"/>
	</xs:complexType>
</xs:schema>
